home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / OS2 / LW32.ZIP / TAP11.ZIP / tap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-04  |  3.8 KB  |  98 lines

  1. #ifndef _TAPDEF
  2. #define _TAPDEF
  3. //
  4. // TAP.H
  5. //
  6. // TAP
  7. // File Transfer Data Sharing
  8. // Shared Header
  9. // Revision 1.10
  10. //
  11. // 12/28/94   First created
  12. //  4/24/95   Structures aligned with DWORDS
  13. //            Dynamic extension lists added
  14. //
  15.  
  16. // #DEFINE for INI Application name
  17. #define TAP_INI_APPNAME "TAP Applications"
  18.  
  19. // DEFINEs for iFlags of TAPINFO
  20. #define TAP_EMERGENCY_CLOSE  0x0001 // Upon receiving this message the file must be immediately closed
  21. #define TAP_CANCEL           0x0002 // File transfer cancelled, file being transferred is aborted
  22. #define TAP_EOF              0x0004 // End of file, file being transferred is now complete
  23. #define TAP_BOF              0x0008 // Begin of file, this is the first information about a new file
  24. #define TAP_EOB              0x0010 // End of batch, transfer is now complete, Application should close pipe *
  25. #define TAP_NEW_SIZE         0x0020 // Set when the current file size has changed
  26. #define TAP_VERSION           0x4000 // Version packet
  27. #define TAP_ACKNOWLEDGE      0x8000 // Set to indicate that acknowledgement is requested
  28.                                                 //
  29.                                                 // * This flag means the pipe should be closed because no more files
  30.                                                 //   will be transferred
  31. // DEFINEs for file size
  32. #define TAP_SIZE_UNKNOWN     -1    // File size will be -1 if unknown
  33.  
  34. typedef union _TAPPACKET {
  35.  
  36.     // This structure is used for TAP_EMERGENCY_CLOSE, TAP_EOF, TAP_EOB, and TAP_ACKNOWLEDGE
  37.  
  38.     struct {
  39.         USHORT cb;                      // Number of bytes in the structure
  40.         USHORT usFlags;                 // Flags, [ TAP_EMERGENCY_CLOSE, TAP_EOF, TAP_EOB, TAP_ACKNOWLEDGE ]
  41.         } flagPacket;
  42.  
  43.     // This structure is used for TAP_NEW_SIZE 
  44.  
  45.     struct {
  46.         USHORT cb;                      // Number of bytes in the structure
  47.         USHORT usFlags;                 // Flags, TAP_NEW_SIZE | [ TAP_EMERGENCY_CLOSE, TAP_EOF, TAP_EOB, TAP_ACKNOWLEDGE, ]
  48.         LONG   lCurrentFileSize;        // Partial current size of the file
  49.         LONG   lCompleteFileSize;       // Size the file will be when complete (-1 if unknown)
  50.         } newSizePacket;
  51.  
  52.     // This structure is used for TAP_BOF
  53.  
  54.     struct {
  55.         USHORT cb;                      // Number of bytes in the structure
  56.         USHORT usFlags;                 // Flags, TAP_BOF | [ TAP_ACKNOWLEDGE, ]
  57.         LONG   lCurrentFileSize;        // Partial current size of the file
  58.         LONG   lCompleteFileSize;       // Size the file will be when complete (-1 if unknown)
  59.         USHORT usFileNameLength;          // Length of file name string
  60.         UCHAR  szFileName[1];           // Fully qualified file name
  61.         } beginFilePacket;
  62.  
  63.     // This structure is used for TAP_VERSION
  64.  
  65.     struct {
  66.         USHORT  cb;                      // Number of bytes in the structure
  67.         USHORT  usFlags;                 // Flags, TAP_VERSION | [ TAP_ACKNOWLEDGE, ]
  68.         USHORT  usVersionLength;            // Length of version string    
  69.         UCHAR   szVersion[1];            // Version string
  70.         } versionPacket;
  71.  
  72. } TAPPACKET, *PTAPPACKET;
  73.  
  74. typedef struct _EXTENSIONLIST
  75. {
  76.    ULONG cb;                      // Number of bytes in the structure
  77.  
  78.    UCHAR szExtension[1];         // Extension handled by this application (of variable size)
  79.                                  // Here, a size of 1 is used to compensate for the NULL
  80.                                  // terminator.
  81. } EXTENSIONLIST, *PEXTENSIONLIST;
  82.  
  83. typedef struct _TAPAPPENTRY
  84. {
  85.     ULONG cb;                           // Number of bytes in this structure,
  86.                                  // including following EXTENSIONLISTs
  87.  
  88.     UCHAR szDescription[256];     // Description of this TAP application
  89.     UCHAR szProgram[CCHMAXPATH];  // Fully qualified path and executable
  90.     UCHAR szParams[84];           // Command line parameters
  91.     ULONG ulExtensions;           // Number of EXTENSIONLISTs that follow
  92.  
  93.    // Extensions handled by this application
  94.     // will follow in memory
  95. } TAPAPPENTRY, *PTAPAPPENTRY;
  96.  
  97. #endif
  98.